﻿@using System.Data;
@using DTcms.Common;
@model DTcms.Model.BaseModel
@{
    ViewBag.Title = "新闻资讯-" + Model.site.name;
    var siteModel = (DTcms.Model.site_channel)Model.info["site_model"];
    string templateskin = Model.templateskin;
}
@section HeaderContent{

}
<!--当前位置-->
<div class="section">
    <div class="location">
        <span>当前位置：</span>
        <a href="@Html.linkurl("index")">首页</a> &gt;
        <a href="@Html.linkurl("news")">新闻资讯</a>
    </div>
</div>
<!--/当前位置-->
<!--推荐资讯-->
<div class="section">
    <div class="wrapper clearfix">
        <div class="wrap-box">
            <div class="left-455" style="margin:0;height:341px;">
                <div id="focus-box" class="focus-box layui-carousel">
                    <div class="slides" carousel-item>
                        @{
                            DataTable focusNews = Html.get_article_list(siteModel.name, 0, 8, "status=0 and is_slide=1 and img_url<>''");
                            foreach (DataRow dr in focusNews.Rows)
                            {
                                <div class="focus-div">
                                    <a title="@dr["title"]" href="@Html.linkurl("news_show", dr["id"])">
                                        <span class="note-bg"></span>
                                        <span class="note-txt">@dr["title"]</span>
                                        <img src="@dr["img_url"]" />
                                    </a>
                                </div>
                            }
                        }
                    </div>
                </div>
            </div>
            <div class="left-455">
                <ul class="side-txt-list">
                    @{
                        DataTable newsList = Html.get_article_list(siteModel.name, 0, 10, "status=0");
                        foreach (DataRow newdr in focusNews.Rows)
                        {
                            int newdr__loop__id = newsList.Rows.IndexOf(newdr) + 1;
                            if (newdr__loop__id == 1 || newdr__loop__id == 6)
                            {
                                <li class="tit"><a href="@Html.linkurl("news_show",newdr["id"])">@newdr["title"]</a></li>
                            }
                            else
                            {
                                <li><span>@Html.datetostr(newdr["add_time"], "yyyy-MM-dd")</span><a href="@Html.linkurl("news_show",newdr["id"])">@newdr["title"]</a></li>
                            }

                        }
                    }
                </ul>
            </div>
            <div class="left-220">
                <ul class="side-img-list">
                    @{
                        DataTable topNewsList = Html.get_article_list(siteModel.name, 0, 4, "status=0 and is_top=1 and img_url<>''");
                        foreach (DataRow topdr in topNewsList.Rows)
                        {
                            int topdr__loop__id = topNewsList.Rows.IndexOf(topdr) + 1;
                            <li>
                                <div class="img-box">
                                    <label>@topdr__loop__id</label>
                                    <img src="@topdr["img_url"]" />
                                </div>
                                <div class="txt-box">
                                    <a href="@Html.linkurl("news_show",topdr["id"])">@topdr["title"]</a>
                                    <span>@Html.datetostr(topdr["add_time"], "yyyy-MM-dd")</span>
                                </div>
                            </li>
                        }
                    }
                </ul>
            </div>
        </div>
    </div>
</div>
<!--/推荐资讯-->
<!--分类推荐-->
<div class="section">
    @{
        var categoryList = Html.get_category_child_list(siteModel.name, 0, 0);
        foreach (var cdr in categoryList)
        {
            var bcategoryList = Html.get_category_child_list(siteModel.name, cdr.id, 0);
            <!--子类-->
            <div class="main-tit">
                <h2>@cdr.title</h2>
                <p>
                    @foreach (var dr in bcategoryList)
                    {
                        <a href="@Html.linkurl("news_list",dr.id)">@dr.title</a>
                    }
                    <a href="@Html.linkurl("news_list",cdr.id)">更多<i>+</i></a>
                </p>
            </div>
            <!--/子类-->
            <div class="wrapper clearfix">
                <div class="wrap-box">
                    <!--左边-->
                    <div class="left-925">
                        <div class="pad-15 bg-wrap">
                            <ul class="rel-list">
                                @{
                                    DataTable dt = Html.get_article_list(siteModel.name, cdr.id, 6, "status=0 and img_url<>''");
                                    foreach (DataRow dr1 in dt.Rows)
                                    {
                                        <li>
                                            <div class="img-box">
                                                <a title="@dr1["title"]" href="@Html.linkurl("news_show",dr1["id"])">
                                                    <img src="@dr1["img_url"]">
                                                </a>
                                            </div>
                                            <div class="info">
                                                <h3><a title="@dr1["title"]" href="@Html.linkurl("news_show",dr1["id"])">@dr1["title"]</a></h3>
                                                <p>@dr1["zhaiyao"]</p>
                                                <span>@dr1["add_time"]</span>
                                            </div>
                                        </li>
                                    }
                                }
                            </ul>
                        </div>
                    </div>
                    <!--/左边-->
                    <!--右边-->
                    <div class="left-220">
                        <div class="pad-15 bg-wrap">
                            <ul class="focus-list">
                                @{
                                    DataTable hotList = Html.get_article_list(siteModel.name, cdr.id, 10, "status=0", "click desc,id desc");
                                    foreach (DataRow dr2 in hotList.Rows)
                                    {
                                        int dr2__loop__id = hotList.Rows.IndexOf(dr2) + 1;
                                        <li>
                                            <label class="@(dr2__loop__id < 2?"hot":"")">@dr2__loop__id</label>
                                            <a href="@Html.linkurl("news_show",dr2["id"])">@dr2["title"]</a>
                                        </li>
                                    }
                                }
                            </ul>
                        </div>
                    </div>
                    <!--/右边-->
                </div>
            </div>
        }
    }
</div>
<!--/分类推荐-->
@section Scripts{
    <script type="text/javascript">
        layui.use(['carousel', 'myaspx'], function () {
            var carousel = layui.carousel, os = layui.myaspx;
            //建造实例
            carousel.render({
              elem: '#focus-box'
              , width: '100%' //设置容器宽度
              ,height:'100%'
              , arrow: 'always' //始终显示箭头
            });
        });
    </script>
}
